package com.lyn.solitude

import android.app.Activity
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding

/**
 * @author longyn 2024/5/12
 * @version 1.0.0
 */
abstract class BaseActivity<V : ViewBinding> : AppCompatActivity() {

    lateinit var binding: V

    abstract fun getViewBinding(): V

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = getViewBinding()
        setContentView(binding.root)
    }


    open fun jump(clazz: Class<*>, finish: Boolean = true) {
        startActivity(Intent(this, clazz))
        if (finish) {
            finish()
        }
    }

    override fun onBackPressed() {

    }
}